Skip to content

Comments

fix: stabilize compiled lock file output ordering#17927

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-compilation-instability
Feb 23, 2026
Merged

fix: stabilize compiled lock file output ordering#17927
pelikhan merged 3 commits intomainfrom
copilot/fix-compilation-instability

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

  • Understand the issue: non-deterministic import ordering and job dependency ordering causes noisy lock file diffs
  • Add the regression test from PR test(parser): add rerun stability contract for import topological order #17925 (TestImportTopologicalSortStableAcrossRuns)
  • Fix getCustomJobsDependingOnPreActivation: sort result of FilterMapKeys before returning
  • Fix getReferencedCustomJobs: sort result of FilterMapKeys before returning
  • Fix buildMainJob: collect sorted job names from data.Jobs map before iterating to build depends
  • Merge origin/main and recompile all 158 workflow files
  • Run make fmt to ensure formatting is correct
Original prompt

Use test in #17925 , run multiple time and fix all sources of compilation instability.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…job dependencies

- Add TestImportTopologicalSortStableAcrossRuns regression test from PR #17925
- Sort getCustomJobsDependingOnPreActivation result for deterministic ordering
- Sort getReferencedCustomJobs result for deterministic ordering
- Fix buildMainJob to iterate data.Jobs in sorted key order when building depends

Fixes #17923

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix sources of compilation instability in tests fix: stabilize compiled lock file output ordering Feb 23, 2026
@pelikhan
Copy link
Contributor

@copilot merge main and recompile

@pelikhan pelikhan marked this pull request as ready for review February 23, 2026 16:07
Copilot AI review requested due to automatic review settings February 23, 2026 16:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes non-deterministic lock file output ordering caused by Go map iteration in the job dependency builder. The unstable ordering of the needs: field in the agent job created noisy diffs across repeated compilations of the same workflow.

Changes:

  • Added a regression test to validate stable import topological ordering across multiple runs
  • Sorted the results of FilterMapKeys in getCustomJobsDependingOnPreActivation and getReferencedCustomJobs
  • Replaced non-deterministic map iteration in buildMainJob with sorted-key iteration for the depends list

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/parser/import_topological_test.go Adds regression test that runs import processing 5 times and verifies identical ordering
pkg/workflow/compiler_jobs.go Sorts results from FilterMapKeys to ensure deterministic ordering in helper functions
pkg/workflow/compiler_activation_jobs.go Replaces direct map iteration with sorted iteration when building job dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

@copilot merge main and recompile

Done — merged origin/main and recompiled all 158 workflow files successfully (ecfd7dd).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw LHkW3RG/jhzfO05V-1 (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c --jq .object.sha (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v5 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha -c=4 -nolocalimports -importcfg /tmp/go-build2167848557/b001/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/cmd/gh-aw/main.go (http block)
  • https://api.github.com/repos/anchore/sbom-action/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/anchore/sbom-action/git/ref/tags/v0 --jq .object.sha (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v6 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/metadata-action/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v5 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/setup-buildx-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan merged commit bd72ffb into main Feb 23, 2026
80 checks passed
@pelikhan pelikhan deleted the copilot/fix-compilation-instability branch February 23, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants